
using Microsoft.EntityFrameworkCore;
using System;

namespace ShoppingCenter.Backend.Api.Model
{
    public static class SeedData
    {
        public static void Seed(this ModelBuilder modelBuilder)
        {
            var currentData = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

            //初始化管理员
            modelBuilder.Entity<Admin>().HasData(
                new Admin
                {
                    Id = 1,
                    Name = "admin",
                    Password = "123",
                    IsActived = true,
                    IsDeleted = false,
                    CreatedTime = currentData,
                    UpdatedTime = currentData,
                    Remarks = "种子数据"
                }

            );
            //初始化用户
            modelBuilder.Entity<User>().HasData(
                new User
                {
                    Id = 1,
                    Name = "uu",
                    Password = "123",
                    IsActived = true,
                    IsDeleted = false,
                    CreatedTime = currentData,
                    UpdatedTime = currentData,
                    Remarks = "种子数据"
                }

            );
            //初始化用户详情
            modelBuilder.Entity<UserMsg>().HasData(
                new UserMsg
                {
                    Id = 1,
                    UserId = 1,
                    Gender = "男",
                    IsActived = true,
                    IsDeleted = false,
                    CreatedTime = currentData,
                    UpdatedTime = currentData,
                    Remarks = "种子数据"
                }

            );


            //初始化规格
            modelBuilder.Entity<Specifications>().HasData(
                new Specifications
                {
                    Id = 1,
                    MerchandiseId = 1,
                    AttributeId = 1,
                    Attribute_valueId = 1,
                    Inventory = 2,
                    Price = 992300,
                    IsActived = true,
                    IsDeleted = false,
                    CreatedTime = currentData,
                    UpdatedTime = currentData,
                    Remarks = "种子数据"
                }

            );
            //初始化属性
            modelBuilder.Entity<Attribute>().HasData(
                new Attribute
                {
                    Id = 1,
                    Name = "颜色",
                    IsActived = true,
                    IsDeleted = false,
                    CreatedTime = currentData,
                    UpdatedTime = currentData,
                    Remarks = "种子数据"
                }

            );


            //初始化属性值
            modelBuilder.Entity<Attribute_value>().HasData(
                new Attribute_value
                {
                    Id = 1,
                    Name = "黄色",
                    IsActived = true,
                    IsDeleted = false,
                    CreatedTime = currentData,
                    UpdatedTime = currentData,
                    Remarks = "种子数据"
                }

            );
            //初始化品类
            modelBuilder.Entity<Commodity_category>().HasData(
                new Commodity_category
                {
                    Id = 1,
                    Name = "军事武器",
                    GradeId = 1,
                    IsActived = true,
                    IsDeleted = false,
                    CreatedTime = currentData,
                    UpdatedTime = currentData,
                    Remarks = "种子数据"
                }
            );


            //初始化商城信息
            modelBuilder.Entity<MallMsg>().HasData(
                new MallMsg
                {
                    Id = 1,
                    Name = "天狗商城",
                    IsActived = true,
                    IsDeleted = false,
                    CreatedTime = currentData,
                    UpdatedTime = currentData,
                    Remarks = "种子数据"
                }

            );


            //初始化商品信息
            modelBuilder.Entity<Merchandise>().HasData(
                new Merchandise
                {
                    Id = 1,
                    Name = "航空母舰",
                    Commodity_categoryId = 1,
                    DetailsId = 1,
                    MerchantId = 1,
                    Msg = "辽宁号超屌",
                    IsActived = true,
                    IsDeleted = false,
                    CreatedTime = currentData,
                    UpdatedTime = currentData,
                    Remarks = "种子数据"
                }

            );
            //初始化商品详情
            modelBuilder.Entity<Details>().HasData(
                new Details
                {
                    Id = 1,
                    Word = "这是去过伊拉克战争的航空母舰，很顶",
                    IsActived = true,
                    IsDeleted = false,
                    CreatedTime = currentData,
                    UpdatedTime = currentData,
                    Remarks = "种子数据"
                }

            );

            //初始化供货商
            modelBuilder.Entity<Supplier>().HasData(
                new Supplier
                {
                    Id = 1,
                    Name = "楼下小黑",
                    Msg = "我这里啥都有",
                    MerchantId = 1,
                    IsActived = true,
                    IsDeleted = false,
                    CreatedTime = currentData,
                    UpdatedTime = currentData,
                    Remarks = "种子数据"
                }

            );
            //初始化商家
            modelBuilder.Entity<Merchant>().HasData(
                new Merchant
                {
                    Id = 1,
                    Name = "航空母舰网购旗舰店",
                    IsActived = true,
                    IsDeleted = false,
                    CreatedTime = currentData,
                    UpdatedTime = currentData,
                    Remarks = "种子数据"
                }

            );
        }

    }
}